﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NGinnBPM.Lib.Messages;

namespace NGinnBPM.Runtime.Messages
{
    /// <summary>
    /// Timeout message. Sent by a task to itself to indicate some kind of timeout.
    /// Correlation and Arg are used to identify what exactly caused the timeout.
    /// </summary>
    [Serializable]
    public class TaskInstanceTimeout : TaskInstanceMessage
    {
        public TaskInstanceTimeout() { }
        public TaskInstanceTimeout(string instanceId)
        {
            this.TargetTaskInstanceId = instanceId;
        }

        string Arg { get; set; }

        public override string ToString()
        {
            return string.Format("{0} [{1}]", GetType().Name, TargetTaskInstanceId);
        }
    }
}
